package com.wudl.govern.mapper;

import com.wudl.govern.domain.MappingField;

import java.util.List;

import com.wudl.govern.domain.MappingSource;
import com.wudl.govern.domain.MappingTable;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * 字段映射关系 Mapp
 *
 * @author wudl
 */
@Mapper
public interface MappingFieldMapp {

    /**
     * 插入记录
     */
    int insert(@Param("entity") MappingField entity);

    /**
     * 通过ID删除
     */
    int deleteById(@Param("id") Integer id);

    /**
     * 通过ID修改
     */
    int updateById(@Param("entity") MappingField entity);

    /**
     * 通过ID查询
     */
    MappingField selectById(@Param("id") Integer id);

    /**
     * 通过条件查询
     */
    List<MappingField> selectList();


    int insertMappingFieldList(List<MappingField> mappingFieldList);

    MappingSource selectSubordinate(@Param("targetSourceId") Integer targetSourceId);

    MappingTable selectMappingSourceOnly(@Param("initSourceId") Integer initSourceId, @Param("targetTableId") Integer targetTableId);

    /**
     * 添加库信息功能
     *
     * @param mappingSource
     * @return
     */
    int insertMappingSource(MappingSource mappingSource);

    //
//添加库集合信息功能
    int insertMappingSourceList(List<MappingSource> mappingSourceList);

    //
    int updateMappingSourceState(@Param("id") Integer id);




    //添加表信息功能
    int insertMappingTable(MappingTable mappingTable);

    //添加库集合信息功能

    //添加表信息功能
    int insertMappingTableList(List<MappingTable> mappingTableList);



    int deleteMappingSourceState(@Param("targetSourceId") Integer targetSourceId);

    int deleteMappingTable(@Param("targetSourtceId") Integer targetSourtceId,@Param("targetTableId")Integer targetTableId );

    int deleteMappingField(@Param("targetTableId") Integer targetTableId,@Param("targetFieldId")Integer targetFieldId );

    List<MappingTable> selectTbaleIds(@Param("targetSourtceId") Integer targetSourtceId);



}